/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "MSG_TIPS")
public class MsgTips extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "消息提示";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_BT = "标题";
	public static final String ALIAS_CONTENT = "内容";
	public static final String ALIAS_TABLEID = "表id";
	public static final String ALIAS_TABLENAME = "表名称";
	public static final String ALIAS_ZT = "状态";
	public static final String ALIAS_XXSJ = "消息时间";
	public static final String ALIAS_URL = "内容url";
	public static final String ALIAS_USERID = "用户id";
	
	//date formats
	public static final String FORMAT_XXSJ = DATE_TIME_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	@Length(max=32)
	private java.lang.String id;
    /**
     * 标题       db_column: BT 
     */ 	
	@Length(max=60)
	private java.lang.String bt;
    /**
     * 内容       db_column: CONTENT 
     */ 	
	@Length(max=500)
	private java.lang.String content;
    /**
     * 表id       db_column: TABLEID 
     */ 	
	@Length(max=32)
	private java.lang.String tableid;
    /**
     * 表名称       db_column: TABLENAME 
     */ 	
	@Length(max=50)
	private java.lang.String tablename;
    /**
     * 状态       db_column: ZT 
     */ 	
	@Max(127)
	private Integer zt;
    /**
     * 消息时间       db_column: XXSJ 
     */ 	
	
	private java.util.Date xxsj;
    /**
     * 内容url       db_column: URL 
     */ 	
	@Length(max=300)
	private java.lang.String url;
    /**
     * 用户id       db_column: USERID 
     */ 	
	
	private Long userid;
	//columns END


	public MsgTips(){
	}

	public MsgTips(
		java.lang.String id
	){
		this.id = id;
	}

	

	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "uuid.hex")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getId() {
		return this.id;
	}
	
	@Column(name = "BT", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getBt() {
		return this.bt;
	}
	
	public void setBt(java.lang.String value) {
		this.bt = value;
	}
	
	@Column(name = "CONTENT", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getContent() {
		return this.content;
	}
	
	public void setContent(java.lang.String value) {
		this.content = value;
	}
	
	@Column(name = "TABLEID", unique = false, nullable = true, insertable = true, updatable = true, length = 32)
	public java.lang.String getTableid() {
		return this.tableid;
	}
	
	public void setTableid(java.lang.String value) {
		this.tableid = value;
	}
	
	@Column(name = "TABLENAME", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getTablename() {
		return this.tablename;
	}
	
	public void setTablename(java.lang.String value) {
		this.tablename = value;
	}
	
	@Column(name = "ZT", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public Integer getZt() {
		return this.zt;
	}
	
	public void setZt(Integer value) {
		this.zt = value;
	}
	
	@Transient
	public String getXxsjString() {
		return DateConvertUtils.format(getXxsj(), FORMAT_XXSJ);
	}
	public void setXxsjString(String value) {
		setXxsj(DateConvertUtils.parse(value, FORMAT_XXSJ,java.util.Date.class));
	}
	
	@Column(name = "XXSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getXxsj() {
		return this.xxsj;
	}
	
	public void setXxsj(java.util.Date value) {
		this.xxsj = value;
	}
	
	@Column(name = "URL", unique = false, nullable = true, insertable = true, updatable = true, length = 300)
	public java.lang.String getUrl() {
		return this.url;
	}
	
	public void setUrl(java.lang.String value) {
		this.url = value;
	}
	
	@Column(name = "USERID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getUserid() {
		return this.userid;
	}
	
	public void setUserid(Long value) {
		this.userid = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Bt",getBt())
			.append("Content",getContent())
			.append("Tableid",getTableid())
			.append("Tablename",getTablename())
			.append("Zt",getZt())
			.append("Xxsj",getXxsj())
			.append("Url",getUrl())
			.append("Userid",getUserid())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof MsgTips == false) return false;
		if(this == obj) return true;
		MsgTips other = (MsgTips)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

